package practice;

public class Public {

    static <T> void swap(T[] arr, int index1, int index2) {
        // 交换数组的两个值
        T tmp = arr[index1];
        arr[index1] = arr[index2];
        arr[index2] = tmp;
    }

    static <T> void showArray(T[] array) {
        // 显示一个数组
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i] + " ");
        }
    }
}
